import * as YvanUI from 'yvan-ui-wotu'

interface Ref {
    t1: YvanUI.Text,
    t2: YvanUI.Text
}

const React = YvanUI.React
const {Card} = YvanUI.Antd
const Observer = YvanUI.Observer
const _ = YvanUI.lodash

export default class Simple2 extends YvanUI.Scope<void, Ref> {

    onRender() {
        window['Simple2'] = this

        // YvanUI.autorun(() => {
        //     console.log('raise!!')
        //     this.refs.t2.visible = (this.main.t1 !== '')
        //     this.main.t2 = this.main.t1 + ' ++'
        //
        // }, {name: 'Simple onRender'})
    }

    vjson = {
        title: '拖拽行排序表格',
        items: [
            {
                view: 'sortableTable',
                columns: [
                    {
                        title: 'Name',
                        dataIndex: 'name',
                        key: 'name',
                    },
                    {
                        title: 'Age',
                        dataIndex: 'age',
                        key: 'age',
                    },
                    {
                        title: 'Address',
                        dataIndex: 'address',
                        key: 'address',
                    },
                    {
                        title: 'Tags',
                        key: 'tags',
                        dataIndex: 'tags',

                    }
                ],
                api: "tableData"

            }
        ]
    }
}

const data = [
    {
        key: '1',
        name: 'John Brown',
        age: 32,
        address: 'New York No. 1 Lake Park',
        tags: ['nice', 'developer'],
    },
    {
        key: '2',
        name: 'Jim Green',
        age: 42,
        address: 'London No. 1 Lake Park',
        tags: ['loser'],
    },
    {
        key: '3',
        name: 'Joe Black',
        age: 32,
        address: 'Sidney No. 1 Lake Park',
        tags: ['cool', 'teacher'],
    },
];